package lab02.test21;

public class Test21 {
    public static void main(String[] args) {

        String result = "ajfkhafbakjlgangkb";
        int count = 0;
        for (int i = 0; i < result.length(); i++) {
            if (result.charAt(i) == 'a') {
                count++;
            }
        }
        System.out.println("该字符串为：" + result);
        System.out.println("其中字母a出现的频率为：" + count);
    }
}
